

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>存储池、归置组和 CRUSH 配置参考 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/doctools.js"></script>
        <script src="../../../_static/sphinx_highlight.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../../genindex/" />
    <link rel="search" title="Search" href="../../../search/" />
    <link rel="next" title="常规配置参考" href="../general-config-ref/" />
    <link rel="prev" title="日志配置参考" href="../journal-ref/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../../" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../../">Ceph 存储集群</a></li>
          <li class="breadcrumb-item"><a href="../">配置</a></li>
      <li class="breadcrumb-item active">存储池、归置组和 CRUSH 配置参考</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../../_sources/rados/configuration/pool-pg-config-ref.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../../" class="icon icon-home"> Ceph
          

          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../start/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephadm/">Cephadm</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../">Ceph 存储集群</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="../">配置</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../storage-devices/">存储设备</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-conf/">配置 Ceph</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/">通用选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#ceph-network-config">网络</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#id3">监视器</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#ceph-osd-config">认证</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#osds">OSDs</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#id5">心跳</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#ceph-logging-and-debugging">日志记录、调试</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#ceph-conf">ceph.conf 实例</a></li>
<li class="toctree-l3"><a class="reference internal" href="../common/#ceph-runtime-config">跑多个集群（已废弃）</a></li>
<li class="toctree-l3"><a class="reference internal" href="../network-config-ref/">网络选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="../msgr2/">信使协议 v2</a></li>
<li class="toctree-l3"><a class="reference internal" href="../auth-config-ref/">认证选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="../mon-config-ref/">监视器选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="../mon-lookup-dns/">通过 DNS 查询监视器</a></li>
<li class="toctree-l3"><a class="reference internal" href="../mon-osd-interaction/">心跳选项（监视器与 OSD 的的交互）</a></li>
<li class="toctree-l3"><a class="reference internal" href="../osd-config-ref/">OSD 选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="../mclock-config-ref/">DmClock 配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="../bluestore-config-ref/">BlueStore 配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="../filestore-config-ref/">FileStore 配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="../journal-ref/">日志选项</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">存储池、归置组和 CRUSH 选项</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id1">命令实例</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id2">手动调整</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id3">参考</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../general-config-ref/">常规选项</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../operations/">运维</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../man/">    手册页</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../troubleshooting/">故障排除</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../api/">APIs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../monitoring/">监控概览</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../hardware-monitoring/">硬件监控</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <section id="crush">
<span id="rados-config-pool-pg-crush-ref"></span><h1>存储池、归置组和 CRUSH 配置参考<a class="headerlink" href="#crush" title="Permalink to this heading"></a></h1>
<p id="index-0">CRUSH 算法分配给每个存储池的归置组数量，
由监视器集群的中央配置数据库中的变量值决定。</p>
<p>Ceph 的容器化部署（用 <code class="docutils literal notranslate"><span class="pre">cephadm</span></code> 或 Rook 做的部署）和 Ceph 的非容器化部署都依赖监视器集群内、中央配置数据库里的值为存储池分配归置组。</p>
<section id="id1">
<h2>命令实例<a class="headerlink" href="#id1" title="Permalink to this heading"></a></h2>
<p>要查看指定存储池中决定归置组数量的变量值，执行下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><style type="text/css">
span.prompt1:before {
  content: "$ ";
}
</style><span class="prompt1">ceph<span class="w"> </span>config<span class="w"> </span>get<span class="w"> </span>osd<span class="w"> </span>osd_pool_default_pg_num</span>
</pre></div></div><p>要设置指定存储池中决定归置组数量的变量值，执行下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>config<span class="w"> </span><span class="nb">set</span><span class="w"> </span>osd<span class="w"> </span>osd_pool_default_pg_num</span>
</pre></div></div></section>
<section id="id2">
<h2>手动调整<a class="headerlink" href="#id2" title="Permalink to this heading"></a></h2>
<p>有些情况下，覆盖某些默认值更好。例如，您可能想设置存储池的副本数并覆盖存储池中归置组的默认数量。您可以用 <a class="reference external" href="../../operations/pools">pool</a> 命令设置这些值。</p>
</section>
<section id="id3">
<h2>参考<a class="headerlink" href="#id3" title="Permalink to this heading"></a></h2>
<p>参见 <a class="reference internal" href="../../operations/placement-groups/#pg-autoscaler"><span class="std std-ref">自动伸缩归置组</span></a> 。</p>
<div class="highlight-ini notranslate"><div class="highlight"><pre><span></span><span class="k">[global]</span>

<span class="w">	</span><span class="c1"># By default, Ceph makes three replicas of RADOS objects. If you want</span>
<span class="w">	</span><span class="c1"># to maintain four copies of an object the default value--a primary</span>
<span class="w">	</span><span class="c1"># copy and three replica copies--reset the default values as shown in</span>
<span class="w">	</span><span class="c1"># &#39;osd_pool_default_size&#39;. If you want to allow Ceph to accept an I/O</span>
<span class="w">	</span><span class="c1"># operation to a degraded PG, set &#39;osd_pool_default_min_size&#39; to a</span>
<span class="w">	</span><span class="c1"># number less than the &#39;osd_pool_default_size&#39; value.</span>

<span class="w">	</span><span class="na">osd_pool_default_size</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">3</span><span class="w">  </span><span class="c1"># Write an object three times.</span>
<span class="w">	</span><span class="na">osd_pool_default_min_size</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">2</span><span class="w"> </span><span class="c1"># Accept an I/O operation to a PG that has two copies of an object.</span>

<span class="w">	</span><span class="c1"># Note: by default, PG autoscaling is enabled and this value is used only</span>
<span class="w">	</span><span class="c1"># in specific circumstances. It is however still recommend to set it.</span>
<span class="w">	</span><span class="c1"># Ensure you have a realistic number of placement groups. We recommend</span>
<span class="w">	</span><span class="c1"># approximately 100 per OSD. E.g., total number of OSDs multiplied by 100</span>
<span class="w">	</span><span class="c1"># divided by the number of replicas (i.e., &#39;osd_pool_default_size&#39;). So for</span>
<span class="w">	</span><span class="c1"># 10 OSDs and &#39;osd_pool_default_size&#39; = 4, we&#39;d recommend approximately</span>
<span class="w">	</span><span class="c1"># (100 * 10) / 4 = 250.</span>
<span class="w">	</span><span class="c1"># Always use the nearest power of two.</span>
<span class="w">	</span><span class="na">osd_pool_default_pg_num</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">256</span>
</pre></div>
</div>
<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_max_pool_pg_num">
<span class="sig-name descname"><span class="pre">mon_max_pool_pg_num</span></span><a class="headerlink" href="#confval-mon_max_pool_pg_num" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>每个存储池的最大归置组数量。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">64Ki</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_pg_stuck_threshold">
<span class="sig-name descname"><span class="pre">mon_pg_stuck_threshold</span></span><a class="headerlink" href="#confval-mon_pg_stuck_threshold" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>多长时间无响应的 PG 才认为它卡住了。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1</span> <span class="pre">minute</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_pg_warn_min_per_osd">
<span class="sig-name descname"><span class="pre">mon_pg_warn_min_per_osd</span></span><a class="headerlink" href="#confval-mon_pg_warn_min_per_osd" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>如果所有状态为 <code class="docutils literal notranslate"><span class="pre">in</span></code> 的 OSD 上的 PG 数量的平均值低于此数值，就向集群日志发出一个 <code class="docutils literal notranslate"><span class="pre">HEALTH_WARN</span></code> 。负数禁用此功能。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_pg_warn_min_objects">
<span class="sig-name descname"><span class="pre">mon_pg_warn_min_objects</span></span><a class="headerlink" href="#confval-mon_pg_warn_min_objects" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>集群内的 RADOS 对象总数小于此数值时不发出警告。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">10000</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_pg_warn_min_pool_objects">
<span class="sig-name descname"><span class="pre">mon_pg_warn_min_pool_objects</span></span><a class="headerlink" href="#confval-mon_pg_warn_min_pool_objects" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>存储池内对象的数量小于此数值时，不发出有关此存储池的警告。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1000</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_pg_check_down_all_threshold">
<span class="sig-name descname"><span class="pre">mon_pg_check_down_all_threshold</span></span><a class="headerlink" href="#confval-mon_pg_check_down_all_threshold" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>倒下的 OSD 百分比阈值，超过此值我们会检查所有 PG ，看有没有掉队的。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0.5</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_pg_warn_max_object_skew">
<span class="sig-name descname"><span class="pre">mon_pg_warn_max_object_skew</span></span><a class="headerlink" href="#confval-mon_pg_warn_max_object_skew" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>如果任意一个存储池内单个 PG 的 RADOS 对象平均数大于所有存储池内单个 PG 对象数的 <code class="docutils literal notranslate"><span class="pre">mon</span> <span class="pre">pg</span> <span class="pre">warn</span> <span class="pre">max</span>
<span class="pre">object</span> <span class="pre">skew</span></code> 倍，就生成一个 <code class="docutils literal notranslate"><span class="pre">HEALTH_WARN</span></code> 。 0 或负数禁用此功能。注意，此选项适用于管理器。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">10.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-mon_delta_reset_interval">
<span class="sig-name descname"><span class="pre">mon_delta_reset_interval</span></span><a class="headerlink" href="#confval-mon_delta_reset_interval" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>多少秒没活动我们就把 pg 增量重置为 0 。我们会跟踪各存储池已用空间的增量，借此，举个例子，
我们可以更容易地理解恢复进度或者缓存层的性能；但是，如果没收到某个存储池的活动情况报告，我们会简单粗暴地重置与它相关的增量历史。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">10.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-osd_crush_chooseleaf_type">
<span class="sig-name descname"><span class="pre">osd_crush_chooseleaf_type</span></span><a class="headerlink" href="#confval-osd_crush_chooseleaf_type" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>在一个 CRUSH 规则内用于 <code class="docutils literal notranslate"><span class="pre">chooseleaf</span></code> 的桶类型。用序数而不是名字。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-osd_crush_initial_weight">
<span class="sig-name descname"><span class="pre">osd_crush_initial_weight</span></span><a class="headerlink" href="#confval-osd_crush_initial_weight" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>给新增 OSD 分配的初始 CRUSH 权重。此选项的默认值是“新增 OSD 的大小， TB 数”。默认情况下，新增 OSD 的初始
CRUSH 权重是设备容量的 TB 数，详情见<a class="reference external" href="../../operations/crush-map#weightingbucketitems">调整桶条目的权重</a>。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">-1.0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-osd_pool_default_crush_rule">
<span class="sig-name descname"><span class="pre">osd_pool_default_crush_rule</span></span><a class="headerlink" href="#confval-osd_pool_default_crush_rule" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>创建多副本存储池时用哪个默认 CRUSH 规则。默认值 <code class="docutils literal notranslate"><span class="pre">-1</span></code> 的意思是“选用规则 ID 数字最小的那条”。此选项的意义在于，没有规则 0 时也能成功创建存储池。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">-1</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-osd_pool_erasure_code_stripe_unit">
<span class="sig-name descname"><span class="pre">osd_pool_erasure_code_stripe_unit</span></span><a class="headerlink" href="#confval-osd_pool_erasure_code_stripe_unit" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>设置纠删码存储池内一个数据块的一个对象条带的默认尺寸，单位为字节。每个尺寸为 S 的对象都将存储成单个数据块为 <code class="docutils literal notranslate"><span class="pre">stripe</span>
<span class="pre">unit</span></code> 字节的 N 个条带，也就是， 各个数据块会接收到 <code class="docutils literal notranslate"><span class="pre">stripe</span> <span class="pre">unit</span></code> 个字节。 每个尺寸为 <code class="docutils literal notranslate"><span class="pre">N</span> <span class="pre">*</span>
<span class="pre">stripe</span> <span class="pre">unit</span></code> 字节的条带将分别独立地编码、解码。 此选项可被纠删码配置中的 <code class="docutils literal notranslate"><span class="pre">stripe_unit</span></code> 选项覆盖。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">size</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">4Ki</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-osd_pool_default_size">
<span class="sig-name descname"><span class="pre">osd_pool_default_size</span></span><a class="headerlink" href="#confval-osd_pool_default_size" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>设置一个存储池的对象副本数，默认值等同于 <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">osd</span> <span class="pre">pool</span> <span class="pre">set</span> <span class="pre">{pool-name}</span> <span class="pre">size</span> <span class="pre">{size}</span></code>
。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">3</span></code></p>
</dd>
<dt class="field-odd">allowed range<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">[0,</span> <span class="pre">10]</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-osd_pool_default_min_size">
<span class="sig-name descname"><span class="pre">osd_pool_default_min_size</span></span><a class="headerlink" href="#confval-osd_pool_default_min_size" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>设置存储池中已写入对象副本的最小数量，以向客户端确认 I/O 操作。如果未达到配置的最小值， Ceph
就不会向客户端反馈已写确认，<strong>谎报可能导致数据丢失</strong>。此选项可确保在降级（ <code class="docutils literal notranslate"><span class="pre">degraded</span></code>
）模式下的最小副本数。默认值是 <code class="docutils literal notranslate"><span class="pre">0</span></code> ，意思是没有最小值。如果设置为 <code class="docutils literal notranslate"><span class="pre">0</span></code> ，最小值是 <code class="docutils literal notranslate"><span class="pre">size</span> <span class="pre">-</span> <span class="pre">(size</span> <span class="pre">/</span>
<span class="pre">2)</span></code> 。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p>
</dd>
<dt class="field-odd">allowed range<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">[0,</span> <span class="pre">255]</span></code></p>
</dd>
<dt class="field-even">see also<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="#confval-osd_pool_default_size"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_pool_default_size</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-osd_pool_default_pg_num">
<span class="sig-name descname"><span class="pre">osd_pool_default_pg_num</span></span><a class="headerlink" href="#confval-osd_pool_default_pg_num" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>一个存储池的默认归置组数量，默认值与 <code class="docutils literal notranslate"><span class="pre">mkpool</span></code> 的 <code class="docutils literal notranslate"><span class="pre">pg_num</span></code> 参数相同。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">32</span></code></p>
</dd>
<dt class="field-odd">see also<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_pool_default_pg_autoscale_mode"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_pool_default_pg_autoscale_mode</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-osd_pool_default_pgp_num">
<span class="sig-name descname"><span class="pre">osd_pool_default_pgp_num</span></span><a class="headerlink" href="#confval-osd_pool_default_pgp_num" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>一个存储池里，为归置使用的归置组默认数量，默认值等同于 <code class="docutils literal notranslate"><span class="pre">mkpool</span></code> 的 <code class="docutils literal notranslate"><span class="pre">pgp_num</span></code> 参数。当前 PG 和
PGP 应该相等。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p>
</dd>
<dt class="field-odd">see also<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_pool_default_pg_num"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_pool_default_pg_num</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-osd_pool_default_pg_autoscale_mode">
<span class="sig-name descname"><span class="pre">osd_pool_default_pg_autoscale_mode</span></span><a class="headerlink" href="#confval-osd_pool_default_pg_autoscale_mode" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>With default value <cite>on</cite>, the autoscaler starts a new pool with 1 pg,
unless the user specifies the pg_num.</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">str</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">on</span></code></p>
</dd>
<dt class="field-odd">valid choices<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">off</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">warn</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">on</span></code></p></li>
</ul>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-osd_pool_default_flags">
<span class="sig-name descname"><span class="pre">osd_pool_default_flags</span></span><a class="headerlink" href="#confval-osd_pool_default_flags" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>新存储池的默认标志。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">0</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-osd_max_pgls">
<span class="sig-name descname"><span class="pre">osd_max_pgls</span></span><a class="headerlink" href="#confval-osd_max_pgls" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>罗列出归置组的最大数量，某一客户端请求量超大时会忙死 OSD 守护进程。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">1Ki</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-osd_min_pg_log_entries">
<span class="sig-name descname"><span class="pre">osd_min_pg_log_entries</span></span><a class="headerlink" href="#confval-osd_min_pg_log_entries" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>清理日志文件的时候，最少保留多少归置组日志。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">250</span></code></p>
</dd>
<dt class="field-odd">see also<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_max_pg_log_entries"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_max_pg_log_entries</span></code></a>, <code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_pg_log_dups_tracked</span></code>, <code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_target_pg_log_entries_per_osd</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-osd_max_pg_log_entries">
<span class="sig-name descname"><span class="pre">osd_max_pg_log_entries</span></span><a class="headerlink" href="#confval-osd_max_pg_log_entries" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>The maximum number of placement group logs to maintain when trimming
log files.</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">10000</span></code></p>
</dd>
<dt class="field-odd">see also<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-osd_min_pg_log_entries"><code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_min_pg_log_entries</span></code></a>, <code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_pg_log_dups_tracked</span></code>, <code class="xref std std-confval docutils literal notranslate"><span class="pre">osd_target_pg_log_entries_per_osd</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-osd_default_data_pool_replay_window">
<span class="sig-name descname"><span class="pre">osd_default_data_pool_replay_window</span></span><a class="headerlink" href="#confval-osd_default_data_pool_replay_window" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>一个 OSD 等待客户端重播请求的时间，单位为秒。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">45</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-osd_max_pg_per_osd_hard_ratio">
<span class="sig-name descname"><span class="pre">osd_max_pg_per_osd_hard_ratio</span></span><a class="headerlink" href="#confval-osd_max_pg_per_osd_hard_ratio" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>集群允许的每个 OSD 上 PG 数量的比率，超过此值 OSD 就会拒绝新建 PG 。如果一个 OSD 上提供服务的 PG 数量超过
<code class="docutils literal notranslate"><span class="pre">osd_max_pg_per_osd_hard_ratio</span></code> * <code class="docutils literal notranslate"><span class="pre">mon_max_pg_per_osd</span></code> ，它就会停止创建新 PG 。</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">float</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">3.0</span></code></p>
</dd>
<dt class="field-odd">min<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">1</span></code></p>
</dd>
<dt class="field-even">see also<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="xref std std-confval docutils literal notranslate"><span class="pre">mon_max_pg_per_osd</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

</section>
</section>



<div id="support-the-ceph-foundation" class="admonition note">
  <p class="first admonition-title">Brought to you by the Ceph Foundation</p>
  <p class="last">The Ceph Documentation is a community resource funded and hosted by the non-profit <a href="https://ceph.io/en/foundation/">Ceph Foundation</a>. If you would like to support this and our other efforts, please consider <a href="https://ceph.io/en/foundation/join/">joining now</a>.</p>
</div>


           </div>
           
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../journal-ref/" class="btn btn-neutral float-left" title="日志配置参考" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../general-config-ref/" class="btn btn-neutral float-right" title="常规配置参考" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).</p>
  </div>

   

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>